package com.ticket.sass.common.entity.tenant;

import com.baomidou.mybatisplus.annotation.*;
import com.ticket.sass.common.entity.tenant.enums.CommodityPublishStatus;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.io.Serializable;
import java.time.LocalDateTime;
import java.util.List;

/**
 * <p>
 * 卖品
 * </p>
 *
 * @author ywb
 * @since 2024-03-06
 */
@Data
@EqualsAndHashCode(callSuper = false)
@TableName("commodities")
@ApiModel(value="CommoditiesEntity对象", description="卖品")
public class CommodityEntity implements Serializable {
    @ApiModelProperty(value = "主键")
    @TableId(value = "id", type = IdType.AUTO)
    private Long id;

    @ApiModelProperty(value = "名称")
    private String name;

    @ApiModelProperty(value = "卖品描述")
    @TableField("\"desc\"")
    private String desc;
    
    @ApiModelProperty(value = "封面图")
    private String cover;
    
    @ApiModelProperty(value = "分类 id")
    private Long categoryId;
    
    @ApiModelProperty(value = "影院 id")
    private Long cinemaId;

    @ApiModelProperty(value = "租户 id")
    private Long tenantId;
    
    @ApiModelProperty(value = "发布状态：0 未发布，1已发布")
    private CommodityPublishStatus publishStatus;
    
    @ApiModelProperty(value = "创建时间")
    @TableField(fill = FieldFill.INSERT)
    public LocalDateTime createdAt;
    
    @ApiModelProperty(value = "更新时间")
    @TableField(fill = FieldFill.INSERT_UPDATE)
    public LocalDateTime updatedAt;
    
    @TableField(select = false)
    @ApiModelProperty(value = "删除时间")
    @TableLogic(value = "null", delval = "now()")
    public LocalDateTime deletedAt;
    
    @ApiModelProperty(value = "分类名")
    @TableField(exist = false)
    private String categoryName;

    @TableField(exist = false)
    private CommodityCategoryEntity category;

    @TableField(exist = false)
    private List<CommoditySkuEntity> skus;

    @TableField(exist = false)
    private List<CommoditySkuAttrEntity> attrs;
    
    public Long getId() {
        return id;
    }
    
    public void setId(Long id) {
        this.id = id;
    }
    
    public String getName() {
        return name;
    }
    
    public void setName(String name) {
        this.name = name;
    }
    
    public String getDesc() {
        return desc;
    }
    
    public void setDesc(String desc) {
        this.desc = desc;
    }
    
    public String getCover() {
        return cover;
    }
    
    public void setCover(String cover) {
        this.cover = cover;
    }
    
    public Long getCategoryId() {
        return categoryId;
    }
    
    public void setCategoryId(Long categoryId) {
        this.categoryId = categoryId;
    }
    
    public Long getCinemaId() {
        return cinemaId;
    }
    
    public void setCinemaId(Long cinemaId) {
        this.cinemaId = cinemaId;
    }
    
    public Long getTenantId() {
        return tenantId;
    }
    
    public void setTenantId(Long tenantId) {
        this.tenantId = tenantId;
    }
    
    public CommodityPublishStatus getPublishStatus() {
        return publishStatus;
    }
    
    public void setPublishStatus(CommodityPublishStatus publishStatus) {
        this.publishStatus = publishStatus;
    }
    
    public LocalDateTime getCreatedAt() {
        return createdAt;
    }
    
    public void setCreatedAt(LocalDateTime createdAt) {
        this.createdAt = createdAt;
    }
    
    public LocalDateTime getUpdatedAt() {
        return updatedAt;
    }
    
    public void setUpdatedAt(LocalDateTime updatedAt) {
        this.updatedAt = updatedAt;
    }
    
    public LocalDateTime getDeletedAt() {
        return deletedAt;
    }
    
    public void setDeletedAt(LocalDateTime deletedAt) {
        this.deletedAt = deletedAt;
    }
    
    public String getCategoryName() {
        return categoryName;
    }
    
    public void setCategoryName(String categoryName) {
        this.categoryName = categoryName;
    }
    
    public CommodityCategoryEntity getCategory() {
        return category;
    }
    
    public void setCategory(CommodityCategoryEntity category) {
        this.category = category;
    }
    
    public List<CommoditySkuEntity> getSkus() {
        return skus;
    }
    
    public void setSkus(List<CommoditySkuEntity> skus) {
        this.skus = skus;
    }
    
    public List<CommoditySkuAttrEntity> getAttrs() {
        return attrs;
    }
    
    public void setAttrs(List<CommoditySkuAttrEntity> attrs) {
        this.attrs = attrs;
    }
}
